#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
int n, a[N], cnt[N], ans;
int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    ans = n;
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
        cnt[a[i]]++;
    }
    int ptr = 1;
    while (!cnt[ptr]) ptr++;
    sort(a + 1, a + 1 + n);
    for (int i = 1; i <= n; ++i) {
        if (a[i] > ptr) {
            cnt[ptr]--;
            while(!cnt[ptr]) ptr++;
            ans--;
        }
    }
    printf("%d", ans);
    return 0;
}
